<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <!--    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no 20" http-equiv="refresh">-->
    <title>中谱分光机机校准系统</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    {% block styles %}
        <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
    {% endblock %}
    <script src="/static/js/jquery-1.12.4.js"></script>
    <script>
        $(function () {
            // 点击事件change
            var item = document.getElementById('moid');
            var item2 = document.getElementById('CCT');
            $('#mo_id1').change('input', function (e) {
                // 获取input值，方法二
                var myvalue = $('#mo_id1').val();
                {# 这是单号输入框的值 #}
                console.log(myvalue);
                if (myvalue.startsWith('5101')) {
                    item.style.display = "block"
                } else {
                    item.style.display = "none";
                }
                var list2 = "{{ moid_list }}";
                var value2 = list2.indexOf(myvalue);
                if (value2 >= 0) {
                    item2.style.display = "block"
                } else {
                    item2.style.display = "none"
                }
                $.ajax({
                    url: '/CCT/' + myvalue,
                    type: 'post',
                    success: (function (dict1) {
                        var item3 = $('#CCT label');
                        console.log(item3);
                        console.log(String(dict1['low']) + "K");
                        item3.first().html(String(dict1['low']) + "K");
                        item3.last().html(String(dict1['high']) + "K");
                    })
                })
            });
        })
    </script>
</head>
<body>


<br>


<div class="container-fluid">


    <div class="row">

        <div class="col-md-1">
            <h5 class="col-md-1 offset-md-11">中谱分光机校准系统</h5>


        </div>

        <div class="col-md-2 offset-md-1">
            <form method="post" enctype="multipart/form-data">
                {{ form1.csrf_token }}
                {{ form1.mo_id1.label }}<br>
                {{ form1.mo_id1(class='form-control') }}
                {% if form1.mo_id1.errors %}
                    {% for message in form1.mo_id1.errors %}
                        <small class="error" style="color: red">{{ message }}</small><br>
                    {% endfor %}
                {% endif %}
                <p id="moid" style="color:red;display:none">请保证使用3个以上标准件校准</p>

                {{ form1.standard_part1.label }}<br>

                {{ form1.standard_part1(class='form-control') }}

                {% if form1.standard_part1.errors %}
                    {% for message in form1.standard_part1.errors %}
                        <small class="error" style="color: red">{{ message }}</small><br>
                    {% endfor %}
                {% endif %}

                {{ form1.user_id1.label }}<br>

                {{ form1.user_id1(class='form-control') }}

                {% if form1.user_id1.errors %}
                    {% for message in form1.user_id1.errors %}
                        <small class="error" style="color: red">{{ message }}</small><br>
                    {% endfor %}
                {% endif %}

                {{ form1.excel_data1.label }}<br>
                {{ form1.excel_data1(class='input-group-btn') }}<br>
                {% if form1.excel_data1.errors %}
                    {% for message in form1.excel_data1.errors %}
                        <small class="error" style="color: red">{{ message }}</small><br>
                    {% endfor %}
                {% endif %}<br>

                <div id="CCT" style="display: none">
                    {#                <div style="display: block">#}
                    {% for item1 in form1.double_choice %}
                        <td>{{ item1 }}</td>
                        <td id="lab">{{ item1.label }}</td><br>
                    {% endfor %}
                </div>
                <br>

                {{ form1.submit1(class='btn btn-success btn-primary btn-block' ) }}<br>
                {% if form1.submit1.data %}
                    {{ url_for('cal') }}
                {% endif %}


                <a href="{{ url_for('cal') }}">--->>> 数 据 刷 新 --->>></a><br>


                <br>
            </form>
        </div>

        <div class="col-md-2 offset-md-1">
            <form method="post" enctype="multipart/form-data">
                {{ form2.csrf_token }}
                {{ form1.mo_id1.label }}<br>
                <span style="font-size: large; font-family:serif; color: black; "> {{ mo_id }}-{{ lotID }}-{{ lotID2 }}</span><br>
                {{ form1.standard_part1.label }}<br>
                <span style="font-size: large; font-family:serif; color: black; "> {{ standard_part }} </span><br>
                {{ form1.user_id1.label }}<br>
                <span style="font-size: large; font-family:serif; color: black; "> {{ user_id }} </span><br>


                {{ form2.excel_data2.label }}<br>
                {{ form2.excel_data2(class='input-group-btn') }}<br>
                {% if form2.excel_data2.errors %}
                    {% for message in form2.excel_data2.errors %}
                        <small class="error" style="color: red">{{ message }}</small><br>
                    {% endfor %}
                {% endif %}

                <br>

                {{ form2.submit2(class='btn btn-success btn-primary btn-block' ) }}<br>
                <a href="{{ url_for('cal') }}">--->>> 数 据 刷 新 --->>></a><br>
                <p>提示：</p>

                {% for message in get_flashed_messages() %}
                    <p class="error" style="color: red">{{ message }}</p><br>

                {% endfor %}




                <br>
            </form>
        </div>


        <div class="col-md-3 offset-md-1 ">
            <form method="post" enctype="multipart/form-data">
                {{ form3.csrf_token }}
                {{ form1.mo_id1.label }}<br>
                <span style="font-size: large; font-family:serif; color: black; ">{{ mo_id }}-{{ lotID }}-{{ lotID2 }}-{{ lotID3 }} </span><br>
                {{ form1.standard_part1.label }}<br>
                <span style="font-size: large; font-family:serif; color: black; "> {{ standard_part }} </span><br>
                {{ form1.user_id1.label }}<br>
                <span style="font-size: large; font-family:serif; color: black; "> {{ user_id }} </span><br>
                {{ form3.excel_data3.label }}<br>
                {{ form3.excel_data3(class='input-group-btn') }}<br>
                {% if form3.excel_data3.errors %}
                    {% for message in form3.excel_data3.errors %}
                        <small class="error" style="color: red">{{ message }}</small><br>
                    {% endfor %}
                {% endif %}
                <br>
                {{ form3.submit3(class='btn btn-success btn-primary btn-block' ) }}<br>
                <a href="{{ url_for('cal') }}">--->>> 数 据 刷 新 --->>></a><br>


            </form>
        </div>

        <div class="col-md-8 offset-md-2">
            <a href="{{ url_for('delete') }}">--->>> 数 据 清 除 --->>></a><br>


        </div>


    </div>
</div>
</body>


</html>


